Token Syntax

Tokens have the following format (syntax): %(TokenName) or %(ActivityName_TokenName). This syntax lets both you and the software know when a bit of text will behave like a token.

Note: The syntax used for tokens has changed from Laserfiche 7 to Laserfiche 8 and higher. All tokens should now be in the following format: %(token).

You can edit the syntax even further if you want to apply Closedfunctions, Closedindexing, Closedformatting, or Closedregular expressions. However, the Token Dialog and Token Editor will automatically create this syntax for you when you choose different options in these dialog boxes.

Functions: %(TokenName#@FunctionName@#). The function's name is placed between #@ and @#. Multiple functions are separated by a semi colon. If the function has a parameter, such as if you specified a delimiter for the Split function, then the parameter is placed between parentheses: %(TokenName#@FunctionName(Parameter)@#). If the function has more than one parameter, the parameters are separated by a comma.

Indexing: %(TokenName_All#[n]#) where n equals the index number of the value you want the token to be replaced by. The syntax to have a token be replaced by all values separated by a delimiter is: %(TokenName_All#[delimiter]#). The delimiter is placed between #[ and ]#.

Formatting: %(TokenName#".NET formatting expression"#). A .NET formatting expression is placed between #" and "#. More information.

Regular Expressions: %(TokenName#<RegularExpression>#). The regular expression is placed between #< and >#, directly after the token name. For example, this syntax %(RetrievePDFFormContents_Address#<\d\d\d\d\d$>#) extracts the zip code from an address.

The forward slash character "/" is an escape character in token syntax. You should escape any characters that will make the token's syntax ambiguous. ClosedShow me an example. The Token Dialog and Token Editor automatically escape characters when necessary.